package com.spring.basic;

import com.study.entity.Person;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @Author HBZ
 * @Date 2020/7/21 17:39
 * @Description
 */
public class Test {
    public static void main(String[] args) {
//        ClassPathXmlApplicationContext context=new ClassPathXmlApplicationContext("spring.xml");
//        Person person=context.getBean("person",Person.class);

        AnnotationConfigApplicationContext context1=new AnnotationConfigApplicationContext(MyConfig.class);
        Person person=context1.getBean("person",Person.class);
        System.out.println(person);
    }


}
